package flc.ast.adapter;

import android.graphics.Color;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.FormatBean;
import flc.ast.bean.MyActorBean;
import stark.common.basic.adaptermutil.StkEmptyProvider;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

public class ActorAdapter extends StkProviderMultiAdapter<MyActorBean> {

    public ActorAdapter() {
        addItemProvider(new StkEmptyProvider<>(112));
        addItemProvider(new ActorProvider());
    }

    private class ActorProvider extends BaseItemProvider<MyActorBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_actor;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyActorBean bean) {
            baseViewHolder.setText(R.id.tvActorItemName,bean.getName());
            Glide.with(baseViewHolder.itemView).load(bean.getImg()).into((ImageView) baseViewHolder.getView(R.id.ivActorItemImg));
        }
    }

}
